import 'package:flutterlib/model/post/post_bean.dart';
import 'package:json_annotation/json_annotation.dart';

part 'post_create_bean.g.dart';

@JsonSerializable()
class PostCreateBean extends Object {
  @JsonKey(name: 'category_ids')
  List<int> categoryIds;

  @JsonKey(name: 'disallow_comment')
  bool disallowComment;

  @JsonKey(name: 'interest_id')
  int interestId;

  @JsonKey(name: 'meta_description')
  String metaDescription;

  @JsonKey(name: 'meta_keywords')
  String metaKeywords;

  @JsonKey(name: 'metas')
  List<Metas> metas;

  @JsonKey(name: 'original_content')
  String originalContent;

  @JsonKey(name: 'password')
  String password;

  @JsonKey(name: 'slug')
  String slug;

  @JsonKey(name: 'status')
  String status;

  @JsonKey(name: 'summary')
  String summary;

  @JsonKey(name: 'tag_ids')
  List<int> tagIds;

  @JsonKey(name: 'thumbnail')
  String thumbnail;

  @JsonKey(name: 'title')
  String title;

  @JsonKey(name: 'top_priority')
  int topPriority;

  @JsonKey(name: 'user_id')
  int userId;

  PostCreateBean(
  {this.categoryIds,
      this.disallowComment,
      this.interestId,
      this.metaDescription,
      this.metaKeywords,
      this.metas,
      this.originalContent,
      this.password,
      this.slug,
      this.status,
      this.summary,
      this.tagIds,
      this.thumbnail,
      this.title,
      this.topPriority,
      this.userId});

  factory PostCreateBean.fromJson(Map<String, dynamic> srcJson) =>
      _$PostCreateBeanFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PostCreateBeanToJson(this);
}
